package a5;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class StatesNames {

	public static void main(String[] args) {
		int[] larray = new int[26];
		String[] words = new String[50];

		try {
				FileReader fileReader = new FileReader("50states (1).txt");
				BufferedReader bufferedReader = new BufferedReader(fileReader);
				String name = bufferedReader.readLine();
			while (name!= null)
			{
				for (int i = 0; i < name.length(); i++) 
				{
					char letter =name.toUpperCase() .charAt(i);
					if ('A' <= letter && 'Z' >= letter)
					{ 
						 larray[letter - 65]++;
					}
				}
				 name = bufferedReader.readLine();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		for ( int i = 0 ; i < larray.length; i++)
		{
			if ( larray[i]== 0)
				System.out.format(" %c %d \n", i+65, larray[i]);
		}

		int lcount=0;
		int letter=0;
		for ( int i=0 ; i < larray.length; i++)
		{
			if ( lcount < larray[i])
			{
				lcount=larray[i];
				letter=i; 
			}
		}
		System.out.format(" %c %d ", letter+65, lcount);


//		for (int i = 1; i < words.length; i++) 
//		{
//			String name = words[i];
//
//			for (char letter = 'a'; letter <= 'z'; letter++) 
//			{
//			}
//
//		}
	}
}
